package meiju;


import java.util.LinkedList;


// 手写组合练习
public class Test03 {
    private static int[] nums = new int[]{1, 3, 5, 7, 9, 10};
    private static int isNeed = 4;
    private static LinkedList<Integer> list = new LinkedList<>();

    public static void dfs(int x){
        if(list.size() == isNeed){
            for (int i = 0; i < list.size(); i++) {
                System.out.print(list.get(i) + " ");
            }
            System.out.println();
            return ;
        }
        if(x >= nums.length){// 剪枝
            return ;
        }
        list.add(nums[x]);
        dfs(x+1);
        list.removeLast();
        dfs(x+1);
    }

    public static void main(String[] args) {
        dfs(0);
    }
}
